* add gnu attribute for format string checks on additional functions.
* silence msvc whining about unknown attributes.
In c++17 unknown attributes should be ignored without causing an error.
But these warnings are excessive:
"warning C5030: attribute 'gnu::format' is not recognized"
if(MSVC)
target_compile_definitions(gpsbabel PRIVATE _CRT_SECURE_NO_WARNINGS)
target_compile_definitions(gpsbabel PRIVATE _CRT_NONSTDC_NO_WARNINGS)
- target_compile_options(gpsbabel PRIVATE /MP -wd4100 -wd4267)
+ target_compile_options(gpsbabel PRIVATE /MP -wd4100 -wd4267 -wd5030)
endif()
if(APPLE)
[[gnu::format(printf, 2, 3)]] int xasprintf(char** strp, const char* fmt, ...);
[[gnu::format(printf, 2, 3)]] int xasprintf(QString* strp, const char* fmt, ...);
[[gnu::format(printf, 2, 3)]] int xasprintf(QScopedPointer<char, QScopedPointerPodDeleter>& strp, const char* fmt, ...);
-int xvasprintf(char** strp, const char* fmt, va_list ap);
+[[gnu::format(printf, 2, 0)]] int xvasprintf(char** strp, const char* fmt, va_list ap);
char* strupper(char* src);
char* strlower(char* src);
time_t mklocaltime(std::tm* time);
int gbfgetc(gbfile* file);
QString gbfgets(char* buf, int len, gbfile* file);
-int gbvfprintf(gbfile* file, const char* format, va_list ap);
-int gbfprintf(gbfile* file, const char* format, ...);
+[[gnu::format(printf, 2, 0)]] int gbvfprintf(gbfile* file, const char* format, va_list ap);
+[[gnu::format(printf, 2, 3)]] int gbfprintf(gbfile* file, const char* format, ...);
int gbfputc(int c, gbfile* file);
int gbfputs(const QString& s, gbfile* file);
int gbfwrite(const void* buf, gbsize_t size, gbsize_t members, gbfile* file);